package com.wmh.baseservice.user.mapper;

import com.wmh.baseservice.user.pojo.UsGroupGoodsOrder;
import com.wmh.baseservice.common.mybatisplus.methods.CommonMapper;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;

import java.math.BigDecimal;
import java.util.List;
import java.util.Map;

/**
 * @author wmh generator
 * @since 2022-03-07
 */
@Repository
public interface UsGroupGoodsOrderMapper extends CommonMapper<UsGroupGoodsOrder> {

    List<UsGroupGoodsOrder> spellGroupList(@Param("id") Long id);

    List<UsGroupGoodsOrder> usList(Long teamId);

    void cancelOrder(Long value);

    /**
     * 根据 [团购商品id(groupGoodsId),规格id(specId),团购批次(batch)]
     * 得到当前此团购商品已下单的数量
     * @param map K为以上值  v 为该值的数值
     * @return 购买数量
     * */
    int totalCount(@Param("map") Map<String, Object> map);

    List<UsGroupGoodsOrder> settlementOrderList(Long id);

    List<Long> thyDayUsAvatar(@Param("id") Long id, @Param("batchNum") Integer batchNum);

    List<UsGroupGoodsOrder> getSettleTheCommissionOrderList(String day);

    /**
     * 查询当前可以结算收益的商家订单
     * @param day 用户完成收货限制日期
     * @return 订单列表
     * */
    List<UsGroupGoodsOrder> getCanSettleEarningsOrderList(String day);

    List<UsGroupGoodsOrder> autoDeliver(String value);

    BigDecimal promoteCommission(List<Long> merchantIds);

    int queryShortOrder(Long usId);
}
